package com.max.xihu.patterns.single;

/**
 * @Author: Max
 * @Date: 2020-08-25 22:38
 * @Description:饿汉式
 */
public class SingletonEH {

    //真是饥渴，提前都给自己new对象了
    private static final SingletonEH instance = new SingletonEH();

    private SingletonEH(){}//私有构造器

    //全局公共访问点
    public static SingletonEH getInstance(){
        return instance;
    }
}
